package com.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the salesopportunities database table.
 * 
 */
@Entity
@Table(name="salesopportunities")
@NamedQuery(name="Salesopportunity.findAll", query="SELECT s FROM Salesopportunity s")
public class Salesopportunity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String salesid;

	private Integer byong;

	private BigDecimal expectmony;

	@Temporal(TemporalType.DATE)
	private Date expecttime;

	private Integer first;

	private String intention;

	private String possibility;

	private String provider;

	private String salestheme;

	private String source;

	private Integer stage;

	@Temporal(TemporalType.DATE)
	private Date stagestop;

	private Integer starstandard;

	private Integer state;

	private String substitutethreat;

	private Integer technology;

	private String type;
	@JsonIgnore
	@Temporal(TemporalType.DATE)
	private Date updatetime;
	@JsonIgnore
	//bi-directional many-to-one association to Quotationrecord
	@OneToMany(mappedBy="salesopportunity")
	private List<Quotationrecord> quotationrecords;

	//bi-directional many-to-one association to Customer
	@ManyToOne
	@JoinColumn(name="customer")
	private Customer customerBean;
	@JsonIgnore
	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="personcharge")
	private Staff staff;

	public Salesopportunity() {
	}

	public String getSalesid() {
		return this.salesid;
	}

	public void setSalesid(String salesid) {
		this.salesid = salesid;
	}

	public Integer getByong() {
		return this.byong;
	}

	public void setByong(Integer byong) {
		this.byong = byong;
	}

	public BigDecimal getExpectmony() {
		return this.expectmony;
	}

	public void setExpectmony(BigDecimal expectmony) {
		this.expectmony = expectmony;
	}

	public Date getExpecttime() {
		return this.expecttime;
	}

	public void setExpecttime(Date expecttime) {
		this.expecttime = expecttime;
	}

	public Integer getFirst() {
		return this.first;
	}

	public void setFirst(Integer first) {
		this.first = first;
	}

	public String getIntention() {
		return this.intention;
	}

	public void setIntention(String intention) {
		this.intention = intention;
	}

	public String getPossibility() {
		return this.possibility;
	}

	public void setPossibility(String possibility) {
		this.possibility = possibility;
	}

	public String getProvider() {
		return this.provider;
	}

	public void setProvider(String provider) {
		this.provider = provider;
	}

	public String getSalestheme() {
		return this.salestheme;
	}

	public void setSalestheme(String salestheme) {
		this.salestheme = salestheme;
	}

	public String getSource() {
		return this.source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public Integer getStage() {
		return this.stage;
	}

	public void setStage(Integer stage) {
		this.stage = stage;
	}

	public Date getStagestop() {
		return this.stagestop;
	}

	public void setStagestop(Date stagestop) {
		this.stagestop = stagestop;
	}

	public Integer getStarstandard() {
		return this.starstandard;
	}

	public void setStarstandard(Integer starstandard) {
		this.starstandard = starstandard;
	}

	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public String getSubstitutethreat() {
		return this.substitutethreat;
	}

	public void setSubstitutethreat(String substitutethreat) {
		this.substitutethreat = substitutethreat;
	}

	public Integer getTechnology() {
		return this.technology;
	}

	public void setTechnology(Integer technology) {
		this.technology = technology;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getUpdatetime() {
		return this.updatetime;
	}

	public void setUpdatetime(Date updatetime) {
		this.updatetime = updatetime;
	}

	public List<Quotationrecord> getQuotationrecords() {
		return this.quotationrecords;
	}

	public void setQuotationrecords(List<Quotationrecord> quotationrecords) {
		this.quotationrecords = quotationrecords;
	}

	public Quotationrecord addQuotationrecord(Quotationrecord quotationrecord) {
		getQuotationrecords().add(quotationrecord);
		quotationrecord.setSalesopportunity(this);

		return quotationrecord;
	}

	public Quotationrecord removeQuotationrecord(Quotationrecord quotationrecord) {
		getQuotationrecords().remove(quotationrecord);
		quotationrecord.setSalesopportunity(null);

		return quotationrecord;
	}

	public Customer getCustomerBean() {
		return this.customerBean;
	}

	public void setCustomerBean(Customer customerBean) {
		this.customerBean = customerBean;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

}